<template>
  <div>
    <Vcode :show="isShow" @success="onSuccess()" @close="onClose" />
  </div>
</template>

<script>
import Vcode from "vue-puzzle-vcode";
export default {
  data() {
    return {
      isShow: false,
      loginform: {
        username: '',
        password: '',
        loginValue: ''
      },
    };
  },
  components: {
    Vcode,
  },
  methods: {
    submit() {
      this.isShow = true;
    },

    onSuccess() {
      console.log('vcode页面接收', this.loginform)
      this.isShow = false;
        this.$store.dispatch('Login', this.loginform).then(() => {
        this.$router.push({
          name: 'index'
        }).catch(error => {
          console.log(error)
        })
      })
    },

    onClose() {
      this.isShow = false;
    },
  },
};
</script>

<style>
</style>

